package com.hui.service;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import lombok.extern.log4j.Log4j;
import org.springframework.stereotype.Service;

/**
 * @author yhq
 * @since 17-3-11.
 */
@SuppressWarnings("unused")
@Service
@Log4j
public class WebService {

    @HystrixCommand(fallbackMethod = "defaultMethod")
    public int getAdd(int a, int b) {
        try {
            Thread.sleep(1000000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("com.hui.service.WebService.getAdd");
        return a + b;
    }

    public int defaultMethod(int a,int b){
        log.info("com.hui.service.WebService.defaultMethod");
        return 9999;
    }

}
